<template>
    <van-popup :value="show" position="bottom" :style="{ height: '40%' }" @click-overlay="cancel">
        <van-area title="地址选择" :area-list="areaList"  @confirm="addressConfirm" @cancel="cancel" />
    </van-popup>
</template>

<script>
import { areaList } from '@vant/area-data';
export default {
    props: {
        value: {
            type: Boolean,
            default: false
        },
        show: {
            type: Boolean,
            default: false
        }
    },
    data () {
        return {
            areaList: areaList
        }
    },
    methods: {
        addressConfirm (val, val1) {
            this.$emit('addressConfirm', val, val1)
            this.$emit('update:show', false)
        },
        cancel () {
            this.$emit('update:show', false)
        }
    }
}
</script>

<style lang="less" scoped>

</style>
